{include file="header.htm" /}
<body class="bodystyle" style="overflow-y: scroll; cursor: default; -moz-user-select: inherit;">
<div id="append_parent"></div>
<div id="ajaxwaitid"></div>
<div class="page min-hg-c-20">
    {include file="bar.htm" /}
    <div class="header-bar">
        <div class="more">
            <div class="search">
                <div class="content">
                    <form id="postForm" action="{:weapp_url('Coupons/log')}" method="get" onsubmit="layer_loading('正在处理');" style="display: unset;">
                        {$searchform.hidden|default=''}
                        <div class="ey-form-item"><label class="users-form-item-label">关键词：</label>
                            <div class="users-form-item-content">
                                <div class="users-select">
                                    <div tabindex="0" class="users-select-selection">
                                        <div class="sDiv2">
                                            <input type="text" size="50" name="keywords" value="{$Request.param.keywords}" class="qsbox" style="width: 170px;" placeholder="优惠券名称或会员信息">
                                        </div>
                                    </div>
                                </div>
                            </div>
                        </div>
                        <div class="ey-form-item"><label class="users-form-item-label">领取方式：</label>
                            <div class="users-form-item-content">
                                <div class="users-select">
                                    <div tabindex="0" class="users-select-selection">
                                        <div class="">
                                            <select name="source">
                                                <option value="" {empty name="$Request.param.source"}selected{/empty}>全部</option>
                                                <option value="1" {eq name="$Request.param.source" value="1"}selected{/eq}>活动领取</option>
                                                <option value="2" {eq name="$Request.param.source" value="2"}selected{/eq}>抽奖奖品</option>
                                                <option value="3" {eq name="$Request.param.source" value="3"}selected{/eq}>后台发放</option>
                                            </select>
                                        </div>
                                    </div>
                                </div>
                            </div>
                        </div>
                        <div class="ey-form-item"><label class="users-form-item-label">使用状态：</label>
                            <div class="users-form-item-content">
                                <div class="users-select">
                                    <div tabindex="0" class="users-select-selection">
                                        <div class="">
                                            <select name="use_status">
                                                <option value="" {empty name="$Request.param.use_status"}selected{/empty}>全部</option>
                                                <option value="-1" {eq name="$Request.param.use_status" value="-1"}selected{/eq}>未使用</option>
                                                <option value="1" {eq name="$Request.param.use_status" value="1"}selected{/eq}>已使用</option>
                                                <option value="2" {eq name="$Request.param.use_status" value="2"}selected{/eq}>已过期</option>
                                                <option value="3" {eq name="$Request.param.use_status" value="3"}selected{/eq}>已冻结</option>
                                            </select>
                                        </div>
                                    </div>
                                </div>
                            </div>
                        </div>
                        <div class="ey-form-item"><label class="users-form-item-label">领取时间：</label>
                            <div class="users-form-item-content">
                                <div class="users-select">
                                    <div tabindex="0" class="users-select-selection">
                                        <div class="sDiv2">
                                            <input type="text" name="get_time" id="get_time" autocomplete="off" value="{$Request.param.get_time}" class="qsbox" placeholder="领取时间">
                                        </div>
                                    </div>
                                </div>
                            </div>
                        </div>
                        <div class="ey-form-item"><label class="users-form-item-label">到期时间：</label>
                            <div class="users-form-item-content">
                                <div class="users-select">
                                    <div tabindex="0" class="users-select-selection">
                                        <div class="sDiv2">
                                            <input type="text" name="end_time" id="end_time" autocomplete="off" value="{$Request.param.end_time}" class="qsbox" placeholder="到期时间">
                                        </div>
                                    </div>
                                </div>
                            </div>
                        </div>
                        <div class="ey-form-item"><label class="users-form-item-label">使用时间：</label>
                            <div class="users-form-item-content">
                                <div class="users-select">
                                    <div tabindex="0" class="users-select-selection">
                                        <div class="sDiv2">
                                            <input type="text" name="use_time" id="use_time" autocomplete="off" value="{$Request.param.use_time}" class="qsbox" placeholder="使用时间">
                                        </div>
                                    </div>
                                </div>
                            </div>
                        </div>
                        <div class="ey-form-item" style="margin-left: 20px;">
                            <div class="users-form-item-content">
                                <input type="submit" class="bt-xin" value="查询" >
                                <a class="bt-xin-no" href="{:weapp_url('Coupons/log')}">重置</a>
                            </div>
                        </div>
                    </form>
                </div>
            </div>
        </div>
    </div>
    <div class="flexigrid mt20 flexigrid-xin">
        <div class="tableDiv " style="height: auto;">
            <div id="flexigrid" cellpadding="0" cellspacing="0" border="0">
                <table cellspacing="0" cellpadding="0" style="width: 100%">
                    <thead style="background-color: #f7f7f7; height: 40px;line-height: 40px;">
                    <tr>
                       <th abbr="article_title" class="">
                           <div class="">优惠券信息</div>
                       </th>
                       <th abbr="article_title" class="w100">
                           <div class="tc">类型</div>
                       </th>
                       <th abbr="article_time" class="w160">
                           <div class="">会员信息</div>
                       </th>
                       <th abbr="article_time" class="w100">
                           <div class="tc">领取方式</div>
                       </th>
                       <th abbr="article_title" class="w140">
                           <div class="tc">领取时间</div>
                       </th>
                       <th abbr="article_time" class="w140">
                           <div class="tc">到期时间</div>
                       </th>
                        <th class="w100">
                            <div class="tc">使用状态</div>
                        </th>
                        <th class="w140">
                            <div class="tc">使用时间</div>
                        </th>
                    </tr>
                    </thead>
                    <tbody class="no-border">
                    {empty name="list"}
                        <tr>
                            <td class="no-data" align="center" axis="col0" colspan="50">
                                <div class="no_row">
                                    <div class="no_pic"><img src="__SKIN__/images/null-data.png"></div>
                                </div>
                            </td>
                        </tr>
                    {else/}
                        {foreach name="list" item="vo" key="k" }
                            <tr>
                                <td>
                                    <div style=" float: left; ">
                                        <span>{$vo.coupon_name}</span>
                                        <span style="color: #939799;">({$vo.condition})</span>
                                    </div>
                                </td>
                                <td>
                                    <div class="tc">
                                        {if condition='1 == $vo.coupon_type'}
                                        全站通用
                                        {elseif condition='2 == $vo.coupon_type' /}
                                        指定商品
                                        {elseif condition='3 == $vo.coupon_type' /}
                                        指定分类
                                        {/if}
                                    </div>
                                </td>
                                <td class="sort ">
                                    <div class="d-flex w160" style=" padding-left: 10px;">
                                        <img id="img_head_pic" style="margin-right: 5px;float: unset;border: 1px solid #e9edef;width: 24px;height: 24px;border-radius: 50%;" src="{$vo.head_pic|get_head_pic=###,false,$vo['sex']}"/>
                                        <a href="javascript:void(0);" data-href="{:url('Member/users_edit',array('id'=>$vo['users_id'],'iframe'=>1))}" onclick="openFullframe(this, '会员资料','100%','100%');" class="l-height-24 ellipsis">{$vo.nickname}</a>
                                    </div>
                                </td>
                                <td>
                                    <div class="tc">
                                        {if condition='1 == $vo.source'}
                                        活动领取
                                        {elseif  condition='2 == $vo.source'}
                                        抽奖奖品
                                        {elseif  condition='3 == $vo.source'}
                                        后台发放
                                        {/if}
                                    </div>
                                </td>
                                <td>
                                    <div class="tc">{$vo.get_time|MyDate='Y-m-d H:i:s',###}</div>
                                </td>
                                <td>
                                    <div class="tc">{$vo.end_time|MyDate='Y-m-d H:i:s',###}</div>
                                </td>
                                <td>
                                    <div class="tc">
                                        {if condition='1 == $vo.use_status'}
                                            <span style="color: #19be6b;">已使用</span>
                                        {elseif  condition='2 == $vo.use_status'}
                                            <span style="color: #b8b9bd;">已过期</span>
                                        {elseif  condition='3 == $vo.use_status'}
                                            <span style="color: #ff1f2c;">已冻结</span>    
                                        {elseif  condition='0 == $vo.use_status'}
                                            <span style="color: #ff1f2c;">未使用</span>    
                                        {/if}
                                    </div>
                                </td>
                                <td>
                                    <div class="tc">
                                        {gt name='$vo.use_time' value='0'}
                                        {$vo.use_time|MyDate='Y-m-d H:i:s',###}
                                        {else /}
                                        <span style="color: #b8b9bd;">0000-00-00 00:00:00</span>
                                        {/gt}
                                    </div>
                                </td>
                            </tr>
                        {/foreach}
                    {/empty}
                    </tbody>
                </table>
            </div>
            <div class="iDiv" style="display: none;"></div>
        </div>

        <div class="tDiv"> <div class="tDiv2"> {include file="public/page" /} </div> <div style="clear:both"></div> </div>
    </div>
</div>
<script type="text/javascript">
    layui.use('laydate', function() {
        var laydate = layui.laydate;
        laydate.render({
            elem: '#get_time'
            ,type: 'datetime'
            ,range: true
        });
        laydate.render({
            elem: '#use_time'
            ,type: 'datetime'
            ,range: true
        });
        laydate.render({
            elem: '#end_time'
            ,type: 'datetime'
            ,range: true
        });
    });

    if (is_conceal_1649209614()){
        $(".page").css("margin-left","");
    }else{
        $(".page").css("margin-left","100px");
    }
    $(function(){
        $('input[name*=ids]').click(function(){
            if ($('input[name*=ids]').length == $('input[name*=ids]:checked').length) {
                $('.checkAll').prop('checked','checked');
            } else {
                $('.checkAll').prop('checked', false);
            }
        });
        $('input[type=checkbox].checkAll').click(function(){
            $('input[type=checkbox]').prop('checked',this.checked);
        });
    });
    $(document).ready(function() {
        // 表格行点击选中切换
        $('#flexigrid > table>tbody >tr').click(function() {
            $(this).toggleClass('trSelected');
        });

        // 点击刷新数据
        $('.fa-refresh').click(function() {
            location.href = location.href;
        });

        // 批量操作
        $(".dropdown-bt").click(function(){
            $(".dropdown-menus").slideToggle(200);
            event.stopPropagation();
        })
        $(document).click(function(){
            $(".dropdown-menus").slideUp(200);
            event.stopPropagation();
        })
    });

</script>
    
<script type="text/javascript">
    /*模拟下拉选择 select */
    $('.cate-select').on('click', '.placeholder', function(e) {
        var parent = $(this).closest('.cate-select');
        if (!parent.hasClass('is-open')) {
            parent.addClass('is-open');
            $('.cate-select.is-open').not(parent).removeClass('is-open');
        } else {
            parent.removeClass('is-open');
        }
        e.stopPropagation();
    }).on('click', 'ul>li', function() {
        var parent = $(this).closest('.cate-select');
        parent.removeClass('is-open').find('.placeholder').text($(this).text());
    });

    $('body').on('click', function() {
        $('.cate-select.is-open').removeClass('is-open');
    });
</script>
{include file="footer.htm" /}
